home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3768 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  904 b 

  1. Path: seas.smu.edu!not-for-mail
  2. From: dbowman@post.smu.edu (Damon Bowman)
  3. Newsgroups: comp.lang.c++
  4. Subject: Q: how to handle currency?
  5. Date: 25 Jan 1996 17:25:34 -0600
  6. Organization: Southern Methodist University
  7. Sender: usenet@seas.smu.edu
  8. Message-ID: <4e93he$ec@sun.cis.smu.edu>
  9. Reply-To: dbowman@post.smu.edu
  10. NNTP-Posting-Host: sun.cis.smu.edu
  11. X-Nntp-Posting-Host: ax4-2.ppp.smu.edu
  12. X-Newsreader: Forte Free Agent 1.0.82
  13.  
  14.  
  15. Another beginner question:
  16.  
  17. What data type is used for currency when you want "precision as
  18. displayed?"  When using the float or double data types, you run into
  19. the problem of imprecision.  In other words, I want to actually round
  20. off my numbers when necessary to create real amounts of EXACTLY 47.23,
  21. or whatever the case may be.
  22.  
  23. One of my books suggests that there is a method of doing this with
  24. integers, but it does not go into any detail.
  25.  
  26. Any assistance is appreciated.
  27.  
  28.